<template>
  <div class="cate1">
    <div
      class="cate-list"
      v-for="(item, index) in categories"
      :key="index"
      @click="itemClick(index)"
      :class="{ iscolor: clickIndex == index }"
    >
      {{ item.title }}
    </div>
  </div>
</template>

<script>
export default {
  props: {
    categories: {
      type: Array,
      default() {
        return [];
      },
    },
  },
  data() {
    return {
      clickIndex: 0,
    };
  },
  methods: {
    itemClick(index) {
      this.clickIndex = index;

      this.$emit("selectItem", index);
    },
  },
};
</script>

<style scoped>
.cate1 {
  height: 100%;
  /* background: pink; */
  font-weight: bold;
}

.cate-list {
  height: 60px;
  width: 100px;
  background-color: #f1f2f6;
  text-align: center;
  line-height: 60px;
  box-shadow: 4px 6px 10px #95a5a6;
  border-bottom: 1px solid #c0d8e7;
}

.iscolor {
  /* background-color:FFC7B4 #; */
  background: url("../../../assets/img/regisetr/login2.jpg");
  font-size: 18px;
  font-weight: bold;
  color: var(--color-tint);
}
</style>
